/*
 *  thread.h
 */

#ifndef THREAD_H
#define THREAD_H

#include <pthread.h>
#include "thread_exception.h"
#include "runnable.h"

class Thread {

public:
    Thread(Runnable& runnable);
    ~Thread();
    void start() throw(ThreadException);
    void join() throw(ThreadException);

private:
    static void* starter(void* args);
    Runnable* runnable; 
    pthread_t pthread;
};

#endif  //THREAD_H

//{+}

